<template>
    <div class="StoreSettings">
        <Navbar :navtitle="title"></Navbar>
        <router-link class="Storelist" v-for="(item,index) in result.items" :key="index" tag="div" to="/StoreSettingsTO">
            <img :src="item.storeGroupResultDTO.doorHeadPhoto" alt="">
            <div class="right">
                <p class="p1">{{item.storeGroupResultDTO.storeName}}</p>
                <p class="p2">{{item.storeGroupResultDTO.allAddress}}</p>
                <p class="p3" v-if="item.shopShippingAreaDTO == null">门店状态：未设置</p>
                <p class="p3">门店状态：关闭</p>
                <!-- <p class="p3">门店状态：正常营业</p> -->

                <img src="../assets/rightj.png" alt="" class="rightj">
            </div>
        </router-link>
    </div>
</template>
<script>
import Navbar from '../components/Navbar';
export default {
    components:{
        Navbar
    },
    data(){
        return{
            title:'门店设置',
            result:[]
        }
    },
    methods:{
        getListStoreByGroup(){
            let headers = {
                "content-type": "application/json"
            };
            if (this.$store.state.token) {
                headers = {
                "content-type": "application/json",
                token: this.$store.state.token,
                userid: this.$store.state.userInfo.id
                };
            }
            let groupId=this.$store.state.merchantInfo.groupId
            this.$http.post('https://web-gateway.newbeescm.com/ms-web/shopInfoController/getListStoreByGroup?groupId='+groupId+'&stareIndex='+0+'&pageNum='+100,{},{headers})
            .then( res =>{
                this.result = res.data.result
                this.$store.commit('setstoreName',res.data.result.items[0].storeGroupResultDTO.createUser)
            })
            .catch( err=> {
                console.log(err)
            })
        }
    },
    created(){
        this.getListStoreByGroup()
    }
}
</script>
<style scoped lang="scss">
.StoreSettings{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #F2F1F6;
    height: 100%;
    width: 100%;
}
.Storelist{
    padding:  0.14rem;
    position: relative;
    background: #fff;
    display: flex;
    &::after{
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        background: #ccc;
        width: 100%;
        height: 1px;
        -webkit-transform: scaleY(0.5);
        transform: scaleY(0.5);
    }
    img{
        width: 0.8rem;
        height: 0.8rem;
    }
    .right{
        flex: 1;
        padding:0 0.15rem;
        width: 100%;
        overflow: hidden;
        .p1{
            color: #333;
            font-size: 0.15rem;
            padding-bottom: 0.08rem;
        }
        .p2{
            color: #9999B3;
            font-size: 0.12rem;
            padding-bottom: 0.18rem;
            overflow:hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
        }
        .p3{
            color: #333;
            font-size: 0.15rem;
        }
        .rightj{
            position: absolute;
            right: 0.14rem;
            top: 0.4rem;
            width: 0.1rem;
            height: 0.15rem;
        }
    }
}
</style>


